\section{debug.\+c File Reference}
\label{debug_8c}\index{debug.\+c@{debug.\+c}}


Ethernet interface for debugging purposes.  


\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \textbf{ ec\+\_\+dbgdev\+\_\+open} (struct net\+\_\+device $\ast$dev)
\begin{DoxyCompactList}\small\item\em Opens the virtual network device. \end{DoxyCompactList}\item 
int \textbf{ ec\+\_\+dbgdev\+\_\+stop} (struct net\+\_\+device $\ast$dev)
\begin{DoxyCompactList}\small\item\em Stops the virtual network device. \end{DoxyCompactList}\item 
int \textbf{ ec\+\_\+dbgdev\+\_\+tx} (struct sk\+\_\+buff $\ast$skb, struct net\+\_\+device $\ast$dev)
\begin{DoxyCompactList}\small\item\em Transmits data via the virtual network device. \end{DoxyCompactList}\item 
struct net\+\_\+device\+\_\+stats $\ast$ \textbf{ ec\+\_\+dbgdev\+\_\+stats} (struct net\+\_\+device $\ast$dev)
\begin{DoxyCompactList}\small\item\em Gets statistics about the virtual network device. \end{DoxyCompactList}\item 
int \textbf{ ec\+\_\+debug\+\_\+init} (\textbf{ ec\+\_\+debug\+\_\+t} $\ast$dbg, \textbf{ ec\+\_\+device\+\_\+t} $\ast$device, const char $\ast$name)
\begin{DoxyCompactList}\small\item\em Debug interface constructor. \end{DoxyCompactList}\item 
void \textbf{ ec\+\_\+debug\+\_\+clear} (\textbf{ ec\+\_\+debug\+\_\+t} $\ast$dbg)
\begin{DoxyCompactList}\small\item\em Debug interface destructor. \end{DoxyCompactList}\item 
void \textbf{ ec\+\_\+debug\+\_\+register} (\textbf{ ec\+\_\+debug\+\_\+t} $\ast$dbg, const struct net\+\_\+device $\ast$net\+\_\+dev)
\begin{DoxyCompactList}\small\item\em Register debug interface. \end{DoxyCompactList}\item 
void \textbf{ ec\+\_\+debug\+\_\+unregister} (\textbf{ ec\+\_\+debug\+\_\+t} $\ast$dbg)
\begin{DoxyCompactList}\small\item\em Unregister debug interface. \end{DoxyCompactList}\item 
void \textbf{ ec\+\_\+debug\+\_\+send} (\textbf{ ec\+\_\+debug\+\_\+t} $\ast$dbg, const uint8\+\_\+t $\ast$data, size\+\_\+t size)
\begin{DoxyCompactList}\small\item\em Sends frame data to the interface. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
static const struct net\+\_\+device\+\_\+ops \textbf{ ec\+\_\+dbg\+\_\+netdev\+\_\+ops}
\begin{DoxyCompactList}\small\item\em Device operations for debug interfaces. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Ethernet interface for debugging purposes. 



\subsection{Function Documentation}
\mbox{\label{debug_8c_a11a1c64e15248046846431990839c0f4}} 
\index{debug.\+c@{debug.\+c}!ec\+\_\+dbgdev\+\_\+open@{ec\+\_\+dbgdev\+\_\+open}}
\index{ec\+\_\+dbgdev\+\_\+open@{ec\+\_\+dbgdev\+\_\+open}!debug.\+c@{debug.\+c}}
\subsubsection{ec\+\_\+dbgdev\+\_\+open()}
{\footnotesize\ttfamily int ec\+\_\+dbgdev\+\_\+open (\begin{DoxyParamCaption}\item[{struct net\+\_\+device $\ast$}]{dev }\end{DoxyParamCaption})}



Opens the virtual network device. 

\begin{DoxyReturn}{Returns}
Always zero (success). 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em dev} & debug net\+\_\+device \\
\hline
\end{DoxyParams}


Definition at line 206 of file debug.\+c.

\mbox{\label{debug_8c_a59052897d8dbe64aba431cc31ba628a9}} 
\index{debug.\+c@{debug.\+c}!ec\+\_\+dbgdev\+\_\+stop@{ec\+\_\+dbgdev\+\_\+stop}}
\index{ec\+\_\+dbgdev\+\_\+stop@{ec\+\_\+dbgdev\+\_\+stop}!debug.\+c@{debug.\+c}}
\subsubsection{ec\+\_\+dbgdev\+\_\+stop()}
{\footnotesize\ttfamily int ec\+\_\+dbgdev\+\_\+stop (\begin{DoxyParamCaption}\item[{struct net\+\_\+device $\ast$}]{dev }\end{DoxyParamCaption})}



Stops the virtual network device. 

\begin{DoxyReturn}{Returns}
Always zero (success). 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em dev} & debug net\+\_\+device \\
\hline
\end{DoxyParams}


Definition at line 223 of file debug.\+c.

\mbox{\label{debug_8c_a753de72c1a12d2dda7fd2817ce8784cc}} 
\index{debug.\+c@{debug.\+c}!ec\+\_\+dbgdev\+\_\+tx@{ec\+\_\+dbgdev\+\_\+tx}}
\index{ec\+\_\+dbgdev\+\_\+tx@{ec\+\_\+dbgdev\+\_\+tx}!debug.\+c@{debug.\+c}}
\subsubsection{ec\+\_\+dbgdev\+\_\+tx()}
{\footnotesize\ttfamily int ec\+\_\+dbgdev\+\_\+tx (\begin{DoxyParamCaption}\item[{struct sk\+\_\+buff $\ast$}]{skb,  }\item[{struct net\+\_\+device $\ast$}]{dev }\end{DoxyParamCaption})}



Transmits data via the virtual network device. 

\begin{DoxyReturn}{Returns}
Always zero (success). 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em skb} & transmit socket buffer \\
\hline
{\em dev} & EoE net\+\_\+device \\
\hline
\end{DoxyParams}


Definition at line 240 of file debug.\+c.

\mbox{\label{debug_8c_ab8061a6af8b6ec3067b2c171fbae47bf}} 
\index{debug.\+c@{debug.\+c}!ec\+\_\+dbgdev\+\_\+stats@{ec\+\_\+dbgdev\+\_\+stats}}
\index{ec\+\_\+dbgdev\+\_\+stats@{ec\+\_\+dbgdev\+\_\+stats}!debug.\+c@{debug.\+c}}
\subsubsection{ec\+\_\+dbgdev\+\_\+stats()}
{\footnotesize\ttfamily struct net\+\_\+device\+\_\+stats $\ast$ ec\+\_\+dbgdev\+\_\+stats (\begin{DoxyParamCaption}\item[{struct net\+\_\+device $\ast$}]{dev }\end{DoxyParamCaption})}



Gets statistics about the virtual network device. 

\begin{DoxyReturn}{Returns}
Statistics. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em dev} & debug net\+\_\+device \\
\hline
\end{DoxyParams}


Definition at line 258 of file debug.\+c.

\mbox{\label{debug_8c_ab4a40ce6bb6a66bd034790c3a7985c80}} 
\index{debug.\+c@{debug.\+c}!ec\+\_\+debug\+\_\+init@{ec\+\_\+debug\+\_\+init}}
\index{ec\+\_\+debug\+\_\+init@{ec\+\_\+debug\+\_\+init}!debug.\+c@{debug.\+c}}
\subsubsection{ec\+\_\+debug\+\_\+init()}
{\footnotesize\ttfamily int ec\+\_\+debug\+\_\+init (\begin{DoxyParamCaption}\item[{\textbf{ ec\+\_\+debug\+\_\+t} $\ast$}]{dbg,  }\item[{\textbf{ ec\+\_\+device\+\_\+t} $\ast$}]{device,  }\item[{const char $\ast$}]{name }\end{DoxyParamCaption})}



Debug interface constructor. 

Initializes the debug object, creates a net\+\_\+device and registeres it.


\begin{DoxyRetVals}{Return values}
{\em 0} & Success. \\
\hline
{\em $<$0} & Error code. \\
\hline
\end{DoxyRetVals}

\begin{DoxyParams}{Parameters}
{\em dbg} & Debug object. \\
\hline
{\em device} & Ether\+C\+AT device. \\
\hline
{\em name} & Interface name. \\
\hline
\end{DoxyParams}


Definition at line 74 of file debug.\+c.

\mbox{\label{debug_8c_a1711152b73dc97bc81a9e9aae4b8a263}} 
\index{debug.\+c@{debug.\+c}!ec\+\_\+debug\+\_\+clear@{ec\+\_\+debug\+\_\+clear}}
\index{ec\+\_\+debug\+\_\+clear@{ec\+\_\+debug\+\_\+clear}!debug.\+c@{debug.\+c}}
\subsubsection{ec\+\_\+debug\+\_\+clear()}
{\footnotesize\ttfamily void ec\+\_\+debug\+\_\+clear (\begin{DoxyParamCaption}\item[{\textbf{ ec\+\_\+debug\+\_\+t} $\ast$}]{dbg }\end{DoxyParamCaption})}



Debug interface destructor. 

Unregisters the net\+\_\+device and frees allocated memory. 
\begin{DoxyParams}{Parameters}
{\em dbg} & debug object \\
\hline
\end{DoxyParams}


Definition at line 115 of file debug.\+c.

\mbox{\label{debug_8c_a683a1dd06041ed934990c736ab3267a9}} 
\index{debug.\+c@{debug.\+c}!ec\+\_\+debug\+\_\+register@{ec\+\_\+debug\+\_\+register}}
\index{ec\+\_\+debug\+\_\+register@{ec\+\_\+debug\+\_\+register}!debug.\+c@{debug.\+c}}
\subsubsection{ec\+\_\+debug\+\_\+register()}
{\footnotesize\ttfamily void ec\+\_\+debug\+\_\+register (\begin{DoxyParamCaption}\item[{\textbf{ ec\+\_\+debug\+\_\+t} $\ast$}]{dbg,  }\item[{const struct net\+\_\+device $\ast$}]{net\+\_\+dev }\end{DoxyParamCaption})}



Register debug interface. 


\begin{DoxyParams}{Parameters}
{\em dbg} & debug object \\
\hline
{\em net\+\_\+dev} & \textquotesingle{}Real\textquotesingle{} Ethernet device. \\
\hline
\end{DoxyParams}


Definition at line 127 of file debug.\+c.

\mbox{\label{debug_8c_a488b3c97e9786a33f2372180de561591}} 
\index{debug.\+c@{debug.\+c}!ec\+\_\+debug\+\_\+unregister@{ec\+\_\+debug\+\_\+unregister}}
\index{ec\+\_\+debug\+\_\+unregister@{ec\+\_\+debug\+\_\+unregister}!debug.\+c@{debug.\+c}}
\subsubsection{ec\+\_\+debug\+\_\+unregister()}
{\footnotesize\ttfamily void ec\+\_\+debug\+\_\+unregister (\begin{DoxyParamCaption}\item[{\textbf{ ec\+\_\+debug\+\_\+t} $\ast$}]{dbg }\end{DoxyParamCaption})}



Unregister debug interface. 


\begin{DoxyParams}{Parameters}
{\em dbg} & debug object \\
\hline
\end{DoxyParams}


Definition at line 152 of file debug.\+c.

\mbox{\label{debug_8c_af11807b9c95c1c4f05aa0cd5a672a560}} 
\index{debug.\+c@{debug.\+c}!ec\+\_\+debug\+\_\+send@{ec\+\_\+debug\+\_\+send}}
\index{ec\+\_\+debug\+\_\+send@{ec\+\_\+debug\+\_\+send}!debug.\+c@{debug.\+c}}
\subsubsection{ec\+\_\+debug\+\_\+send()}
{\footnotesize\ttfamily void ec\+\_\+debug\+\_\+send (\begin{DoxyParamCaption}\item[{\textbf{ ec\+\_\+debug\+\_\+t} $\ast$}]{dbg,  }\item[{const uint8\+\_\+t $\ast$}]{data,  }\item[{size\+\_\+t}]{size }\end{DoxyParamCaption})}



Sends frame data to the interface. 


\begin{DoxyParams}{Parameters}
{\em dbg} & debug object \\
\hline
{\em data} & frame data \\
\hline
{\em size} & size of the frame data \\
\hline
\end{DoxyParams}


Definition at line 167 of file debug.\+c.



\subsection{Variable Documentation}
\mbox{\label{debug_8c_a1049a945f6a46b9a8a8ab4684958d59f}} 
\index{debug.\+c@{debug.\+c}!ec\+\_\+dbg\+\_\+netdev\+\_\+ops@{ec\+\_\+dbg\+\_\+netdev\+\_\+ops}}
\index{ec\+\_\+dbg\+\_\+netdev\+\_\+ops@{ec\+\_\+dbg\+\_\+netdev\+\_\+ops}!debug.\+c@{debug.\+c}}
\subsubsection{ec\+\_\+dbg\+\_\+netdev\+\_\+ops}
{\footnotesize\ttfamily const struct net\+\_\+device\+\_\+ops ec\+\_\+dbg\+\_\+netdev\+\_\+ops\hspace{0.3cm}{\ttfamily [static]}}

{\bfseries Initial value\+:}
\begin{DoxyCode}
=
\{
    .ndo\_open = ec_dbgdev_open,
    .ndo\_stop = ec_dbgdev_stop,
    .ndo\_start\_xmit = ec_dbgdev_tx,
    .ndo\_get\_stats = ec_dbgdev_stats,
\}
\end{DoxyCode}


Device operations for debug interfaces. 



Definition at line 56 of file debug.\+c.

